//
//  LBFacListView.h
//  app
//
//  Created by luckyRoy on 2017/5/4.
//  Copyright © 2017年 NAICAI LI. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UIView+FacMethods.h"
#import "LBFacListViewBlockManager.h"
#import "LBFacCollectionViewFlowLayout.h"

@interface LBFacListView : UIView

@property (strong, nonatomic, readonly) UITableView *tableView;

@property (strong, nonatomic, readonly) UICollectionView *collectionView;

@property (assign, nonatomic) BOOL isOneSection;//default Yes

@property (assign, nonatomic) BOOL isCellHighlight;//default Yes

@property (strong, nonatomic) NSMutableArray *cellModelArray;

- (instancetype)initTableViewWithFrame:(CGRect)frame
                              cellName:(NSString *)name
                             cellClick:(LBFacListViewCellClick)cellClick
                            otherClick:(LBFacListViewOtherClick)cellViewClick;

- (instancetype)initCollectionViewWithFrame:(CGRect)frame
                                   cellName:(NSString *)name
                            maxItemsOneLine:(NSInteger)num
                                      click:(LBFacListViewCellClick)cellClick
                                 otherClick:(LBFacListViewOtherClick)cellViewClick;

- (instancetype)initCollectionViewWithFlowLayout:(LBFacCollectionViewFlowLayout *)customFlowLayout
                                           frame:(CGRect)frame
                                        cellName:(NSString *)name
                                 maxItemsOneLine:(NSInteger)num
                                           click:(LBFacListViewCellClick)cellClick
                                      otherClick:(LBFacListViewOtherClick)cellViewClick;


/*
 viewClass: if collectionView must use subClass of LBFacCollectionReusableView
            or tableView must use subClass of LBFacTableViewHeaderFooterView
 */
- (instancetype)registerHeaderViewClass:(Class)viewClass
                       HeaderModelBlock:(LBFacListViewSectionViewModel)modelBlock;

- (instancetype)registerHeaderViewClass:(Class)viewClass
                       HeaderModelBlock:(LBFacListViewSectionViewModel)modelBlock
                        HeaderViewClick:(LBFacBaseViewButtonClick)clickBlock;

- (instancetype)customCollectionCellWithSize:(LBCustomCollectionCellSizeBlock)customCellSize;

- (void)reloadListView;

@end
